
level = 6

def setLevel(l):
    level = l

def debug(fmt, *args):
    if level >= 6:
        print("[DEBUG] ", fmt, args)

def info(fmt, *args):
    if level >= 5:
        print("[INFO] ", fmt, args)

def warn(fmt, *args):
    if level >= 4:
        print("[WARN] ", fmt, args)

def error(fmt, *args):
    if level >= 3:
        print("[ERROR] ", fmt, args)

def fatal(fmt, *args):
    if level >= 2:
        print("[FATAL] ", fmt, args)

class Log:
    def __init__(self):
        self.level = 6

    def set_level(self, value):
        self.level = value

    def debug(self, string):
        if self.level >= 6:
            print(string)

    def info(self, string):
        if self.level >= 5:
            print(string)

    def warn(self, string):
        if self.level >= 4:
            print(string)

    def error(self, string):
        if self.level >= 3:
            print(string)

    def fatal(self, string):
        if self.level >= 2:
            print(string)
